#include <linux/smp.h>
#include <linux/cpu.h>

#include "_boot_/cpu_ops.c"

static int start_secondary_cpu(int cpu, struct task_struct *tidle)
{
    int err = -EOPNOTSUPP;

	if (cpu_ops->cpu_start)
		err = cpu_ops->cpu_start(cpu, tidle);

    return err;
}

int __cpu_up(unsigned int cpu, struct task_struct *tidle)
{
    int ret;

    ret = start_secondary_cpu(cpu, tidle);

    return ret;
}

void smp_callin(void)
{
    unsigned int curr_cpuid = smp_processor_id();

    notify_cpu_starting(curr_cpuid);

    local_irq_enable();
    cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
}
